<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <canvas width="800" height="600"></canvas>
    <script>
        let canvas = document.querySelector('canvas');
        let ctx = canvas.getContext('2d');

        // 径向渐变指的是根据两个圆之间的差形成的圆环，在这一部分进行渐变
        let radia = ctx.createRadialGradient(400,300,0,400,300,300);
        radia.addColorStop(0,'#303133');
        radia.addColorStop(0.5,'#606266');
        radia.addColorStop(1,'#909399');
        ctx.fillStyle = radia;
        ctx.fillRect(0,0,800,600);
    </script>
</body>
</html>